Skip to main content

HTTP to HTTPS Redirect

(QW.HTTPtoHTTPSRedirect)

Overview

This is a private feature developed by Qwilt.

If you want to block your site from being accessed over HTTP, you can configure an HTTP to HTTPS Redirect to force the CDN to redirect HTTP requests to HTTPs. The configuration also sets the response code.

Example

This example forces an HTTP to HTTPS redirect with status code 301.

{
"generic-metadata-type": "MI.PrivateFeature.Qwilt.QW.HTTPtoHTTPSRedirect",
"generic-metadata-value": {
"allow-redirect": true,
"redirect-code": "301"
}
}

Supported Properties

FieldValid ValuesDescription
allow-redirecttrue, falseEnables or disables the redirect.
redirect-code301, 302, 307, 308A string specifying the HTTP status code for the redirect. Required if allow-redirect is true.

Supported Status Code Descriptions

Status CodeDescription
301Permanent redirect that tells the client the resource is permanently moved to the new HTTPS URL. This is the default status code value.
302Temporary redirect that tells the client the resource is temporarily located at the new HTTPs URL.
307Temporary redirect that also ensures that the HTTP method and body remain unchanged in the redirected request. Use this code when it's critical to maintain the original request method and body (such as for POST requests).
308Permanent redirect that also ensures that the HTTP method and body remain unchanged in the redirected request. Use this code when it's critical to maintain the original request method and body (such as for POST requests).